local function on_val(self, value)
    self.inst.replica.ymh_eat_marble:SetVal(value)
end

local ymh_eat_marble = Class(function(self, inst)
    self.inst = inst
    self.val = 0
end,
nil,
{
    val = on_val,
})

function ymh_eat_marble:OnSave()
    return {
        val = self.val
    }
end

function ymh_eat_marble:OnLoad(data)
    self.val = data.val or 0
end

function ymh_eat_marble:DoDelta(delta)
    self.val = self.val + delta
end

function ymh_eat_marble:IsMax()
    return self.val >= TUNING.MOD_YUEMIHENG.EAT_MARBLE.MAX
end

function ymh_eat_marble:GetBuffSpecificValue()
    return self.val * TUNING.MOD_YUEMIHENG.EAT_MARBLE.PER
end

return ymh_eat_marble